package com.spdg.ring.sqlite.model;

import java.util.Comparator;

import cn.wolf.tools.StringUtil;

public class ComparatorArticleList implements Comparator<ArticleList> {

	@Override
	public int compare(ArticleList obj1, ArticleList obj2) {
		ArticleList articleList1 = (ArticleList) obj1;
		ArticleList articleList2 = (ArticleList) obj2;

		String parentFile1 = articleList1.getParentFile();
		String parentFile2 = articleList2.getParentFile();

		if (StringUtil.isEmpty(parentFile2) || StringUtil.isEmpty(parentFile1))
			return -1;
		return articleList1.getParentFile().compareTo(articleList2.getParentFile());
	}
}
